﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ItemCategory.aspx.cs" Inherits="Main_Item_NewItemCategory" EnableEventValidation="false" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Src="~/User Controls/CommonControls.ascx" TagName="CommonControls" TagPrefix="MyControls" %>
<%@ Register Src="~/User Controls/Pager.ascx" TagPrefix="custom" TagName="Pager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Items Category</title>
     <link href="../../../Styles/accounts.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="divmain">
        <acc:heading ID="pagehead" runat="server" HeadingText="Item Category" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <div style="margin-left:35%;"><asp:Label ID="lblMsg" runat="server" Font-Bold="true" EnableViewState="false"></asp:Label></div> 
        <asp:UpdateProgress DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel1" ID="UpdProgress" runat="server">
        <ProgressTemplate>
          <div align="center"><img src="../../Images/ajax-loader.gif" /></div>
        </ProgressTemplate>
        </asp:UpdateProgress>
        <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
        <table class="tablecontent"  style= "width:40%;margin-left:30%; margin-right:30%; border:1px solid #818181" >
              <tr>
                <td class="headtd" colspan="2"> 
                   Category Details
               </td>
             </tr>
             
             <tr>
                <td> Category Name <span class="required">*</span> </td>
                <td> <asp:TextBox ID="TxtCategoryName" runat="server"  Width="130px" ValidationGroup="name" ToolTip="Enter Category Name" CssClass ="input"  title="Test" ></asp:TextBox>
                     <asp:RequiredFieldValidator ID="RFVCategoryName" runat="server" ValidationGroup="name" ControlToValidate="TxtCategoryName" ErrorMessage="*" ></asp:RequiredFieldValidator>
                </td>
            </tr>
            
              <tr>
                
                <td> </td>
                <td>
                    <asp:Button ID="Insert" runat="server" Text="Submit" CssClass="button" ValidationGroup="name"
                        onclick="Insert_Click" />                  
                </td>
                
            </tr>
        </table>
        </asp:Panel>
       </ContentTemplate>
       </asp:UpdatePanel>
       
       <asp:Panel ID="PnlView" runat="server" Visible="false">

       <div style="margin-left:25%; margin-right:25%; width:50%"> 
        <asp:UpdateProgress DynamicLayout="false" AssociatedUpdatePanelID="UpdatePanel2" ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
          <div align="center"><img src="../../Images/ajax-loader.gif" /></div>
        </ProgressTemplate>  
        </asp:UpdateProgress>
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="controls" />
        </Triggers>
        <ContentTemplate>
        <div style=" padding-top:15px; padding-bottom:5px; margin-left:30%;">  
           <div style="float:left;"><custom:Pager ID="custPager" runat="server" OnPageChanged="custPager_PageChanged" /></div>
           <div style="float:left; margin-left:10px;"> <MyControls:CommonControls ID="controls" runat="server" GridviewControlId="GridCategory" HideColumns="3" /> </div>
         </div>   
         <div id="divprint" runat="server">
        <asp:GridView ID="GridCategory" runat="server"  Width="100%" AllowPaging="true"
               PageSize="20"   DataKeyNames="ICAID" AutoGenerateColumns="false" 
                 RowStyle-CssClass="gridviewitem" PagerStyle-CssClass="pgr"
               CssClass="gridview"  AlternatingRowStyle-CssClass="gridview_alternate" onrowediting="GridCategory_RowEditing" 
               onrowcancelingedit="GridCategory_RowCancelingEdit" 
               onrowupdating="GridCategory_RowUpdating" 
               onrowdatabound="GridCategory_RowDataBound1" 
               onpageindexchanging="GridCategory_PageIndexChanging" 
                 onrowcreated="GridCategory_RowCreated" onsorting="GridCategory_Sorting" >
            <Columns>
                <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="S.No.">
                    <ItemTemplate><%#Container.DataItemIndex+1%></ItemTemplate>
               </asp:TemplateField>
                <asp:BoundField HeaderText="Category Name" DataField="ICANAME" SortExpression="ICANAME" />  
                <asp:BoundField HeaderText="Predefined" DataField="ICAPREDEF" ReadOnly="true" />     
                <%--<asp:CommandField HeaderText="Action"  EditText="<img src='../../Menu/images/Edit_user.png' alt='Edit'>" ShowEditButton="true" UpdateText="<img src='../../Menu/images/update.png' alt='Update'>" CancelText="<img src='../../Menu/images/cancel.png' alt='Cancel'>" ItemStyle-HorizontalAlign="Center" /> --%>
                 <asp:TemplateField HeaderText="Action" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                       <asp:LinkButton ID="lnkEdit" CommandArgument='<%#Eval("ICAID") %>' CommandName="Edit" runat="server" Font-Underline="false" ><img src="../../Menu/images/Edit_user.png" alt="Edit" visible="false"/></asp:LinkButton>
                       <asp:LinkButton ID="LinkButton1" CommandArgument='<%#Eval("ICAID") %>' CommandName="Update" runat="server" Font-Underline="false" Visible="false" ><img src="../../Menu/images/update.png" alt="Edit"/></asp:LinkButton>
                       <asp:LinkButton ID="LinkButton2" CommandArgument='<%#Eval("ICAID") %>' CommandName="Cancel" runat="server" Font-Underline="false" Visible="false"><img src="../../Menu/images/cancel.png" alt="Edit"/></asp:LinkButton>
                       <asp:Image ID="imgLock" runat="server" ImageUrl ="../../Images/lock.png" Height="16px" Width="16px"  AlternateText="Locked" Visible="false" />                   
                    </ItemTemplate>
                </asp:TemplateField>       
            </Columns>     
            <PagerStyle HorizontalAlign="Right" />
          </asp:GridView>
        
       </div> 
      
     </ContentTemplate>
        </asp:UpdatePanel>
        </div>
        </asp:Panel>
    </div>
     
    </form>
</body>
</html>
